
<table id="TabTable" width=95%"">
<!--                                <caption>Justificaciones por aprovar</caption>-->
    <thead>
        <tr>
            <th scope="col">Asunto</th>
            <th scope="col">Empleado</th>
            <th scope="col">Horario de Entrada</th>
            <th scope="col">Hora que marcó</th>
            <th scope="col">Justificación</th> 
            <th scope="col">Aprobar</th>

        </tr>
    </thead>
    <tfoot>
    <th colspan="6"> <?php
if ($total == 1)
    echo 'Total: ' . $total . ' notificación';
else
    echo 'Total: ' . $total . ' notificaciones';
?></th>
</tfoot>


<tbody id="notificacion">
    <?php
    $attributes = array('id' => 'aprobar');
    if ($tardia_por_aprobar <> NULL) {
        foreach ($tardia_por_aprobar->result() as $record):

            echo "<tr>";
            echo "<td>";
            if ($record->estado == 2) {
                echo "Tardia";
            } else {
                echo "Ausencia";
            }
            echo "</td>";
            echo "<td>";
            echo $record->nombre;
            echo " ";
            echo $record->apellidos;
            echo "</td>";
            echo "<td>";
            echo $record->entrada;
            echo "</td>";
            echo "<td>";
            echo $record->hora_actual;
            echo "</td>";
            echo "<td>";
            echo $record->justificacion;
            echo "</td>";
            echo "<td>";
            echo form_open('ver_marcas/aprobarTardiaAusencia_form_run/');
            echo form_hidden('marca', $record->marca);
            echo form_hidden('cedula', $record->cedula);
            echo form_hidden('enviar', 1);
            echo form_submit('Submit', 'Aprobar', 'class = "botonA"');
            echo form_close();

            echo form_open('ver_marcas/reprobarTardiaAusencia_form_run/');
            echo form_hidden('marca', $record->marca);
            echo form_hidden('cedula', $record->cedula);
            echo form_hidden('enviar', 1);
            echo form_submit('Submit', 'Rechazar', 'class = "botonR"');
            echo form_close();
            echo "</td>";
            echo "</tr>";
        endforeach;
    } else {
        echo '<b style= "color:#fe8300" font-size= "18pt">No hay mas notificaciones</b><br><br>';
    }
    ?>
</tbody>  
</table>
<br/>
<div class="pagination">

    <?php
    echo $paginacion;
    ?>

</div>

<script type="text/javascript">
    $(document).ready(function(){
        applyPagination();
        function applyPagination() {
            $("div.pagination a").click(function() { 
                var form_data = {
                    ajax: '1',
                    cual: '1'
                };
                $.ajax({
                    type: "POST",
                    url: $(this).attr('href'),
                    data: form_data,
                    beforeSend: function() {
                        $("#Notif_1").html("");
                    },
                    success: function(msg){
                        $('#Notif_1').html(msg);
                        //applyPagination();
                    }
                });               
                return false;
            });            
        }
    });
    
</script>	
</html>
